package com.isi.mtl.lf.ex3.managers;

import java.sql.SQLException;
import java.util.ArrayList;

import com.isi.mtl.lf.ex3.entites.Modele;
import com.isi.mtl.lf.ex3.services.BDDMapConfig;

public class ModeleManager {
	
	@SuppressWarnings("unchecked")
	public static ArrayList<Modele> getModeleByIdMarque(int idMarque) {
		
		ArrayList<Modele> alModeles = null;
		
		try {
			alModeles = (ArrayList<Modele>) BDDMapConfig.getBddMapClient().queryForList("selectModeleByMarqueId", idMarque);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return alModeles;
		
	}
	
	public static Modele getModeleByModeleId(int id){
		Modele m = null;
		try {
			m = (Modele)BDDMapConfig.getBddMapClient().queryForObject("selectModeleByModeleId", id);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
		
		return m;
	}
	

}
